package com.lqk.command;

/**
 * @author lqk
 * @date 2021/12/8 20:29
 */
public class LightOffCommand implements Command {

    LightReceiver light;

    public LightOffCommand(LightReceiver light) {
        this.light = light;
    }

    @Override
    public void execute() {
        // 调用接受者的方法
        light.off();
    }

    @Override
    public void undo() {
        light.on();
    }
}
